<?php if(isset($_SESSION['user']['user_id']) && $_SESSION['user']['user_id']!=""){?>
<div class="col-md-8">
<div class="main-content" id="main-content">
		<div class="sub-content">
			<div class="top-header page-header clearfix">
				<h1>User Profile</h1>
			</div>
			<div class="top-links">
				<ul class="form-progress-bar">
					<? if(isset($_GET['edit']) && $_GET['edit']!=""){?>
						<li class="active-menu step-no"><a href="<? echo $this->Url('users')?>/user-previous?user_id=<? echo $_GET['user_id'];?>&edit=1"><span>1</span></a></li>
						<li class="indicator active-menu"><span></span></li>
						<li class="active-menu step-no"><a  href="<? echo $this->Url('users')?>/super-user-next?user_id=<? echo $_GET['user_id'];?>&edit=1"><span>2</span></a></li>
						<li class="indicator active-menu"><span></span></li>
						<li class="active-menu step-no"><a  href="<? echo $this->Url('users')?>/super-user-confirm?user_id=<? echo $_GET['user_id'];?>&edit=1"><span>3</span></a></li>
					<?}else if(isset($_GET['user_id']) && $_GET['user_id']!=""){?>
						<li class="active-menu step-no"><a href="<? echo $this->Url('users')?>/user-previous?user_id=<? echo $_GET['user_id'];?>"><span>1</span></a></li>
						<li class="indicator active-menu"><span></span></li>
						<li class="active-menu step-no"><a  href="<? echo $this->Url('users')?>/super-user-next?user_id=<? echo $_GET['user_id'];?>"><span>2</span></a></li>
						<li class="indicator active-menu"><span></span></li>
						<li class="active-menu step-no"><a  href="<? echo $this->Url('users')?>/super-user-confirm?user_id=<? echo $_GET['user_id'];?>"><span>3</span></a></li>
					<?}else{?>
						<li class="active-menu step-no"><a href="<? echo $this->Url('users')?>/user-previous"><span>1</span></a></li>
						<li class="indicator active-menu"><span></span></li>
						<li class="active-menu step-no"><a  href="<? echo $this->Url('users')?>/super-user-next"><span>2</span></a></li>
						<li class="indicator active-menu"><span></span></li>
						<li class="active-menu step-no"><a  href="<? echo $this->Url('users')?>/super-user-confirm"><span>3</span></a></li>
					<?}?>					
				</ul>
			</div>
		<div class="user-profile1 col-md-12">
				<form id="signupForm" name="signupForm"  method="post" class="form-horizontal" role="form">
					
						<div class="form-group">
							<label class="control-label col-sm-3">Company Name</label>
							<div class="col-sm-9">
							<?if(isset($_SESSION['usersinfo']['cname'])){?>
								<input  type="text" id="cname" name="cname" readonly="readonly" class="form-control" value="<? echo $_SESSION['usersinfo']['cname'];?>" placeholder="Company Name"> 
							<?}else if(isset($this->user_details->company_name)){?>
								<input  type="text" id="cname" name="cname" readonly="readonly" class="form-control" value="<? echo $this->user_details->company_name;?>" placeholder="Company Name"> 
							<? }?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Industry </label>
							<div class="col-sm-9">
								<?if(isset($_SESSION['usersinfo']['industry_name'])){?>
									<input  type="hidden" id="industry" name="industry"  value="<? echo $_SESSION['usersinfo']['industry'];?>" placeholder="Industry Name"> 							
								<?}else if(isset($this->user_details->industryname)){?>
									<input type="text" id="industry1" name="industry1" class="form-control" readonly="readonly" value="<? echo $this->user_details->industryname;?>">
									<input type="hidden" id="industry" name="industry" value="<? echo $this->user_details->industry;?>">
								<? }?>	
							</div>							
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Address 1</label>	
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['address1'])){?>
								<textarea  readonly="readonly" class="profile_add form-control" id="address1" name="address1" ><? echo $_SESSION['usersinfo']['address1'];?></textarea>
							<?} else if(isset($this->user_details->address1)){?>
								<textarea  readonly="readonly" class="profile_add form-control" id="address1"  name="address1" ><? echo $this->user_details->address1;?></textarea>
							<?}?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Address 2</label>					
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['address2'])){?>
								<textarea  readonly="readonly" class="profile_add form-control" id="address2" name="address2" ><? echo $_SESSION['usersinfo']['address2'];?></textarea>
							<?} else if(isset($this->user_details->address2)){?>
								<textarea  readonly="readonly" class="profile_add form-control" id="address2"  name="address2" ><? echo $this->user_details->address2;?></textarea>
							<?}?></div>		
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Address 3</label>	
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['address3'])){?>
								<textarea  readonly="readonly" class="profile_add form-control" id="address3" name="address3" ><? echo $_SESSION['usersinfo']['address3'];?></textarea>
							<?} else if(isset($this->user_details->address2)){?>
								<textarea  readonly="readonly" class="profile_add form-control" id="address3"  name="address3" ><? echo $this->user_details->address3;?></textarea>
							<?}?></div>		
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Landmark Near By</label>	
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['lmnear'])){?>
								<input  type="text" id="lmnear" name="lmnear" readonly="readonly" class="form-control" value="<? echo $_SESSION['usersinfo']['lmnear'];?>" placeholder="Landmark Near By"> 							
							<?} else if(isset($this->user_details->landmarknearby)){?>
								<input  type="text" id="lmnear" name="lmnear" readonly="readonly" class="form-control" value="<? echo $this->user_details->landmarknearby;?>" placeholder="Landmark Near By"> 							
							<?}?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">City</label>	
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['city'])){?>
								<input  type="text" id="city" name="city" readonly="readonly" class="form-control" value="<? echo $_SESSION['usersinfo']['city'];?>" placeholder="City"> 							
							<? }else if(isset($this->user_details->city)){?>
								<input  type="text" id="city" name="city" readonly="readonly" class="form-control" value="<? echo $this->user_details->city;?>" placeholder="City"> 							
							<? }?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Country</label>
							<div class="col-sm-9">
								<? if(isset($_SESSION['usersinfo']['country_name'])){?>
									<input type="hidden" id="country" name="country" value="<? echo $_SESSION['usersinfo']['country'];?>">
								<? }else if(isset($this->user_details->usercountry)){?>
									<input  type="text" id="country1" name="country1" readonly="readonly" class="form-control" value="<? echo $this->user_details->usercountry;?>" /> 							
									<input type="hidden" id="country" name="country" value="<? echo $this->user_details->country;?>">
								<?}?>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Email</label>
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['email'])){?>
								<input  readonly="readonly" type="text" id="email" name="email"  class="form-control" value="<? echo $_SESSION['usersinfo']['email'];?>" placeholder="Email" />						
							<? } else if(isset($this->user_details->email)){?>
								<input  readonly="readonly" type="text" id="email" name="email" class="form-control" value="<? echo $this->user_details->email;?>" placeholder="Email" />
							<? }?>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Phone</label>
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['phone'])){?>
								<input  readonly="readonly" type="text" id="phone" name="phone" class="form-control" value="<? echo $_SESSION['usersinfo']['phone'];?>" placeholder="Phone" />
							<?} else if(isset($this->user_details->phone)){?>
								<input  readonly="readonly" type="text" id="phone" name="phone"  class="form-control" value="<? echo $this->user_details->phone;?>" placeholder="Phone" />
							<?} ?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Fax </label>	
<div class="col-sm-9">							
							<? if(isset($_SESSION['usersinfo']['fax'])){?>
								<input readonly="readonly" type="text" id="fax" name="fax"  class="form-control" placeholder="Fax" value="<? echo $_SESSION['usersinfo']['fax'];?>" />
							<?}else if(isset($this->user_details->fax)){?>
								<input readonly="readonly"  type="text" id="fax" name="fax" class="form-control" placeholder="Fax" value="<? echo $this->user_details->fax;?>" />
							<?}?></div>						
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Contact Person 1</label>	
<div class="col-sm-9">							
							<? if(isset($_SESSION['usersinfo']['cperson'])){?>
								<input readonly="readonly" type="text" id="cperson" name="cperson" class="form-control"  value="<? echo $_SESSION['usersinfo']['cperson'];?>" placeholder="Contact Person 1"> 
							<?}else if(isset($this->user_details->contact_person)){?>
								<input readonly="readonly" type="text" id="cperson" class="form-control" value="<? if(isset($this->user_details->contact_person)){echo $this->user_details->contact_person;}?>" name="cperson" placeholder="Contact Person 1">
							<?} ?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Mobile No</label>					
							 <div class="col-sm-9">
							 <? if(isset($_SESSION['usersinfo']['mobile'])){?>
								<input readonly="readonly" type="text" id="mobile" name="mobile"  class="form-control" value="<? echo $_SESSION['usersinfo']['mobile'];?>" placeholder="Mobile No"> 
							<?}else if(isset($this->user_details->mobile)){?>
								<input readonly="readonly" type="text" id="mobile" class="form-control" value="<? if(isset($this->user_details->mobile)){echo $this->user_details->mobile;}?>" name="mobile" placeholder="mobile No" />
							<?}?></div>		
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Email Address</label>					
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['second_email'])){?>
								<input readonly="readonly" type="text" id="email1" name="email1"  class="form-control" value="<? echo $_SESSION['usersinfo']['second_email'];?>" placeholder="Email"> 
							<?} else if(isset($this->user_details->second_email)){?>
								<input readonly="readonly" type="text" id="email1" name="email1" class="form-control" value="<? if(isset($this->user_details->second_email)){echo $this->user_details->second_email;}?>" placeholder="Email" />
							<?}?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Bank Address</label>	
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['baddress'])){?>
								<textarea readonly="readonly" class="profile_add form-control"  id="baddress" name="baddress" placeholder="Bank Address" ><? echo $_SESSION['usersinfo']['baddress'];?></textarea>
							<?}else if(isset($this->user_details->bankaddress)){?>
								<textarea readonly="readonly" class="profile_add form-control"  id="baddress" name="baddress" placeholder="Bank Address" ><? echo $this->user_details->bankaddress;?></textarea>
							<?}?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Account No</label>
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['acno'])){?>
								<textarea readonly="readonly" class="profile_add form-control"  id="acno" name="acno" placeholder="Account No" ><? echo $_SESSION['usersinfo']['acno'];?></textarea>
							<?}else if(isset($this->user_details->account_number)){?>
								<textarea readonly="readonly" class="profile_add form-control"  id="acno" name="acno" placeholder="Account No" ><? echo $this->user_details->account_number;?></textarea>
							<? }?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">Note</label>	
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['note'])){?>
							    <textarea readonly="readonly" class="profile_add form-control"  id="note" name="note" placeholder="Note" ><? echo $_SESSION['usersinfo']['note'];?></textarea>
							<?} else if(isset($this->user_details->note)){?>
								<textarea readonly="readonly" class="profile_add form-control"  id="note" name="note" placeholder="Note" ><? echo $this->user_details->note;?></textarea>
							<?}?></div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3">User Type</label>
							<div class="col-sm-9">
							<? if(isset($_SESSION['usersinfo']['type'])){?>
								<? if($_SESSION['usersinfo']['type']=='superadmin'){?>
									<input readonly="readonly" type="text" readonly="readonly" id="type1" class="form-control" value="Superadmin" name="type1" placeholder="Type of user" />
									<input  type="hidden" readonly="readonly" id="type" value="<? echo $_SESSION['usersinfo']['type']; ?>" name="type" placeholder="Type of user" />
								<?}?>
							<?} else if(isset($this->user_details->user_type)){?>
								<input  type="text" readonly="readonly" id="type" class="form-control" value="<? echo $this->user_details->user_type;?>" name="type" placeholder="Type of user" />
							<?}?></div>
						</div>
						<? if(isset($_GET['edit']) || isset($_GET['user_id'])){?>
							<div class="form-group">							
								<? if(isset($_SESSION['user']['status'])){
									if($_SESSION['user']['status']='0'){
										$status='Pending';
									}else if($_SESSION['user']['status']='1'){
										$status='Activate';
									}else if($_SESSION['user']['status']='2'){
										$status='Deactivate';
									}?>
								<?}else if(isset($this->user_details->u_status)){
									if($this->user_details->u_status='0'){
										$status='Pending';
									}else if($this->user_details->u_status='1'){
										$status='Activate';
									}else if($this->user_details->u_status='2'){
										$status='Deactivate';
									}?>
									<input type="hidden" id="status" name="status" value="<? echo $this->user_details->u_status;?>" />
								<?}?>							
								<label class="control-label col-sm-3">Status</label>
								<div class="col-sm-9">
								<input readonly="readonly" type="text" class="form-control" readonly="readonly" value="<? echo $status;?>" placeholder="Select the status"> </div>		
							</div>
						<?}?>
						<input type="hidden" id="hid_user_id" name="hid_user_id" value="<? if(isset($this->user_details->user_id)){echo $this->user_details->user_id;}?>"/>					
						<input type="hidden" id="edit_status" name="edit_status" value="<? if(isset($_GET['edit'])){echo $_GET['edit'];}?>">
						<div class="adding_list form-group">
							<label class="col-sm-3">&nbsp;</label>
								
									<? if(isset($_GET['edit']) && $_GET['edit']!=""){?>
										<a  class="back_btn btn btn-danger" role="button" href="<? echo $this->Url('users')?>/user-next?user_id=<? echo $_GET['user_id'];?>&edit=1">Back</a>
									<?}else if(isset($_GET['user_id']) && $_GET['user_id']!=""){?>
										<a  class="back_btn btn btn-danger" role="button" href="<? echo $this->Url('users')?>/user-next?user_id=<? echo $_GET['user_id'];?>">Back</a>
								   <?} else{?>
								   	 <a class="back_btn btn btn-danger" role="button" href="<? echo $this->Url('users')?>/user-next">Back</a>
								   <?}?>
								   <a class="btn btn-danger"  id="continue" onclick="return validate();" role="button" href="javascript:void(0)">Submit</a>
									<div id="loading" style="display:none;float:right;margin-right:30px;"><img src="<?php echo $this->basePath() ?>/images/loading_image.gif" /></div>
								
							
						</div>
					
				</form>
		</div>
	</div>
</div></div>
<script>
function validate(){
	$("#loading").show();
	$("#signupForm").submit();
}
</script>
<?php }else{?>
<script>
	window.location='<? echo $this->Url('home')?>';
</script>
<?php }?>
	

        